package com.chao.common.util.reaction;

import com.chao.common.util.reaction.Reaction;
import com.chao.common.util.reaction.ReactionCode;

/**
 * 统一返回类
 * chao
 */
public class ReactionImpl implements Reaction {

    /**
     * 返回编码
     */
    private Integer code;

    /**
     * 描述
     */
    private String message;

    /**
     * 数据
     */
    private Object data;

    public ReactionImpl() {
        this.code = ReactionCode.OK;
        this.message = "请求成功";
    }

    public ReactionImpl(int returnCode,String message) {
        this.code = returnCode;
        this.message = message;
    }

    public ReactionImpl(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public ReactionImpl(Object data) {
        this.code = ReactionCode.OK;
        this.message = "请求成功";
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
